<template>
	<view class="list flex-col" @click="emits('click')">
		<view class="flex justify-between">
			<view class="time">{{ data.delivery_earliest_time }}</view>
			<view class="pendingorders">距离{{ data.linear_distance }}km</view>
		</view>
		<view class="content">
			<view class="left">
				<view class="line">
					<image mode="widthFix" src="@/static/image/ji.png"></image>
					<view class="line-right">
						<view class="name">
							{{ data.start_street }}
						</view>
						<view class="address">
							{{ data.start_address }}
						</view>
					</view>
				</view>
				<view class="line">
					<image mode="widthFix" src="@/static/image/shou.png"></image>
					<view class="line-right">
						<view class="name">
							{{ data.recipient_street }}
						</view>
						<view class="address">
							{{ data.recipient_address }}
						</view>
					</view>
				</view>
			</view>
			<image class="pat" :src="data.pet_img"></image>
		</view>
		<view class="bottom">
			<view class="left">
				<view class="label">{{ data.delivery_type }}</view>
				<view class="desc">{{ data.tips }}</view>
			</view>
			<image mode="widthFix" v-if="data.can_taking == 0" class="level" src="@/static/image/level.png"></image>
		</view>
	</view>
</template>

<script setup>
	const props = defineProps({
		data: {
			type: Object,
			default: () => {}
		}
	})
	const emits = defineEmits(['click'])
</script>

<style scoped lang="scss">
	.list {
		background: #FFFFFF;
		box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(128, 128, 128, 0.06);
		border-radius: 32rpx;
		padding: 30rpx 28rpx;
		margin-bottom: 16rpx;
		position: relative;

		.time {
			font-family: PingFang SC, PingFang SC;
			font-weight: 600;
			font-size: 32rpx;
			color: #2C1F21;
		}

		.pendingorders {
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 20rpx;
			color: #F1692B;
		}

		.content {
			display: flex;
			justify-content: space-between;

			.left {
				width: calc(100% - 180rpx);

				.line {
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin-top: 20rpx;

					image {
						width: 30rpx;
						height: 30rpx;
					}

					.line-right {
						width: calc(100% - 45rpx);

						.name {
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							font-size: 28rpx;
							color: #2C1F21;
							line-height: 33rpx;
						}

						.address {
							margin-top: 10rpx;
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							font-size: 24rpx;
							color: #A6A1A1;
							line-height: 28rpx;
						}
					}
				}
			}

			.pat {
				width: 170rpx;
				height: 170rpx;
				border-radius: 32rpx;

			}
		}

		.bottom {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 20rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 600;
			font-size: 32rpx;
			color: #2C1F21;
			line-height: 38rpx;

			.left {
				display: flex;
				align-items: center;

				.label {
					background: rgba(100, 90, 240, 0.14);
					border-radius: 8rpx;
					height: 42rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 24rpx;
					color: #645AF0;
					line-height: 28rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					padding: 0 10rpx;
					margin-right: 10rpx;
				}

				.desc {
					font-family: PingFang SC, PingFang SC;
					font-weight: 600;
					font-size: 28rpx;
					color: #2C1F21;
					line-height: 33rpx;
				}
			}
			.level {
				width: 96rpx;
				position: absolute;
				right: 0;
				bottom: 0;
			}
		}
	}
</style>